/*
** create_string.c for  in /home/renard/Dropbox/epitech/dev/projets/systemunix/zappy/zappy-2015-2014s-renard_g/serv-src
**
** Made by guillaume renard
** Login   <renard_g@epitech.net>
**
** Started on  Thu Jun 21 16:13:48 2012 guillaume renard
** Last update Thu Jul 19 17:29:14 2012 pierrick druart
*/

#include		<unistd.h>
#include		<stdlib.h>
#include		<stdio.h>

#include		"move_map.h"
#include		"string.h"
#include		"server.h"

static const char	*ptrRess[] =
{
  " nourriture",
  " linemate",
  " deraumere",
  " sibur",
  " mendiane",
  " phiras",
  " thystame",
  " joueur"
};

void			create_string2(t_string *string, int ress,
    int nb, t_mov m)
{
  int			i;

  i = 0;
  while (i < nb)
    {
      if (ress == JOUEUR && m.movX == m.x && m.movY == m.y && i == 0)
	;
      else
	string->concat(string, ptrRess[ress]);
      i++;
    }
}

void			create_string(t_string *string, t_inventory cas, t_mov m)
{
  int			i;

  i = 0;
  while (i < 8)
  {
    create_string2(string, i, cas.inv[i], m);
    i++;
  }
}

